Fix double login problem (closes #56)