Some small cosmetic changes in js code