Fixed the logout problem and a couple of syntax errors.