Attempt to improve the watch function

I think I may have broken things when I applied jshint related changes.