Fix and corresponding test for issue #139

The only negative side effect is that if your model for a node has a lot of properties that are rarely used you will get nodes in the database that have a lot of properties with null values.