patch/instance.updateAttributes: changes discussed on #1449

Pull Request created from #1720, since i've "lost" access to my older repo.
Please add a space after `if` and remove the ones by the paranthesis. And either place the code on the samle line or wrap it in brackets.