Revert "Revert "Fixes errors caused by extra ents""

This reverts commit d0f1cb01777fcab1e38eb9c36d31e6470d0ee5c2.