Fix strict mode bugs

The code wouldn't run in strict mode without these fixes!