Javascript minor fixes