Add some assertion, use an unsigned loop variable (that matches GPtrArray.len type), and add a comment.