Tweaks

Some tweaks to make the user login experience nicer, particularly in the case where the default user is set (which is actually not handled by the testing emulator as far as I can see!). See individual commits for details.