Fixed JS Bugs