Minor changes to javascript