Fixed JS generation bug.