Fix logout bug and variable name bug

@ianbarber please review these two bug fixes.