Use strict mode

Enabled strict mode, and fixed some issues this raised.