Fixing JS compiler bugs. Work in progress.