JSHint fixes and bug fixes with autocomplete