Fixed bug in entity manager flush