minor bug fixes on javascript