Fixing entity issues found by unit tests
Fixing tests for nullables