Forgot some JS bug fixes