adding test for toJS handling of nil and fixing said failing test