Added count check to prevent 0 count error

This will crash when trying to get objectAtIndex: 0 if the count is 0 (of course!)