Check if error is null or undefined
Bring entity type syntax up to date
Removed trailing whitespaces