Added checks to omit NSNull values in addition to nil values. This is needed for NSDictionaries that do not allow nil values.