I cannot help you here as I don't have the file. I assume the reason is
one of your strange preamble hacks. To find the reason, copy the file
and remove everything except of one text line. If you then still have
problems, remove the preamble stuff step by step until you found the
problematic code.
For the debugging of your preamble I recommend to put it in a external file.
Put the following in preable part of your document settings:
\input{preamble.tex}
Then create and edit preamble.tex with the editor of your choice.
This is also an advantage becaue you'll be able to reuse the preable,
have different versions etc.