Fixes to JS generation.