Added logout and common goto functions.