Formatting fix

Fixed code formatting.
Incorporated fixes into code

Main.lsl had bugfixes from commit dd431dafed8d10e5a7f6c32bdb67a30e669cadb5;
incorporated them by hand.