Fix inconsistencies in js output.