Creatures move oddly after a battle

Sometimes, after a battle, my creatures will get separated from me and walk diagonally until they get stuck somewhere.