Fixed deletion of patterns from entity manager.