Modified EntityFactory to make correct spawn() calls.