FIx some javscript UI bugs