It's still a bug though, the first key can be anything. In fact, the keys could be (1, 0). (Unless getMessages is guaranteed to return a zero-based numeric array.)