Small bug fixes

Some bug fixes to clear up some rare blocking issue and a rapid log in / log out / log in with the same user.