Javascript fixes

fixes