Fixing stupid bugs in JS because Im stupid.