Corrected Script, Renamed some Codeblocks

Have changed some errors, that was coming from "gedit". Loading it does without problems now. Have changed had, so that we use L_Main or LG_Main as begin.