Fixed logout bug, testbugs fixed.