Main Bug should be fixed

I've done some testing on my pc and the code seems to be working good. Checked with transclusions, <noinclude>,<includeonly>, etc. I have also checked it on the LaTeX Debug page of WikiFM.