Fix bugs for unlogged users