Simple js improvements

A few simple js improvements.