I have had very weird bugs lately, one of them being the ships suddenly being displayed all bright. After a day or two of trying to find it, I gave up and thought of another way: I compared the scripts to an older backup and found out a completely different part of the script made the ships bright (a wrong str_cat call, I think it was). So I changed that and since then I have not gotten the level_load crash.
I'll see if it happens again...