Then sprinkle
warns throughout the code (yours and/or Movable Type) to see how far execution does get, so that you can gradually zero in on the culprit. Once you know where it happens, you have a much better chance of finding out what goes wrong.
Makeshifts last the longest.