Fixed warnings/errors reported by jshint