fixed validation of entities
PSR2 fixes
merged conflicts