Fixes up coding standards, null checks and strongly typed enums in EntityController