Fix crashes upon wrenching machines.