Fixed wrong id return in EntityManager, and delete id shift