Added logout page and improved some controller behavior