js fixes and other little gotchyas