Fix various JS lint code smells