Add 'return this;' where suitable, fix jshint warnings.