Fix minor javascript bugs.