Minor JavaSript Bugs Fix