check for nulls in toJSON
1.8.1