Fixed bug in objectOrNilForKey