Fix bug with fake auth, and make more flexible