Added sanity tests. Fixed some bugs with visilibity and being logged in/out