Fix error in generated JavaScript