Fix bugs; finish auth.