Fixed a few things left out of JS refactoring #594