Fix issues caused by bad merge of 7302e5b

The merge of 7302e5b introduced issues after the branch was mistakenly merged
to master and then deleted. The branch was reassembled, but the reassembly was
incomplete and introduced bugs causing user updates to fail to function
correctly. This change completes the changes form the original branch and
fixes the issues with user updates.