Re #1359 javascript fixes