Updated array access to be compatible with iOS 5.