improved js doc and minor fixes