Minor syntactic edits and error fixing

I have changed the source according to some syntactic standards, and minor error fixing with `arguments`, type coerced comparisons with `null` and var redefinition.