Fixes a memory corruption causing a run.exe crash which has been reported multiple times on the dev and users mailing lists.