bugfixes and tests for User#update