Fixed issue with logout and referencing.