Fixes #16 where by if an attribute on the model was null, an exception would be thrown