Fixed logout issues