LOTS of fixes to make signin work