Javascript fixes