Fix propertyName handling
Add test for an empty database