A few bug fixes, mainly around login.