delete nil or empty arrays. fixes issue of improperly set dictionaries.
Added unit tests for nil operations on NSArray and NSDictionary