Fix up javascript