Fixed a bug in generated js.