Fixes some issues with logout and layout.