more JS bug fixes..