Fixed a very rare crashing bug.