Fix JS issues and coding conventions from PR feedback