bug fix and formatting fixes

Fixing issue with / to - replacement and fixing jshint errors