Fix for issue #22

Hi,

I've added a failing test and a fix for nullable key properties that are mapped to non-nullable columns. Fixes #22.