Fix auth error and some small fixes