Fixes for strict mode

With these fixes, runs in strict mode