Fixed all compilation errors in Entity.