Some fixes for updating.

Still doesn't work when logging in.