Migration, fixes to logout