Fix up some deprecated stuff and logout