Merge logout changes from master