Minor tidy up for JS style and formatting