Fix logout URL (again).
Improve logging and fix logout.