Major set of fixes to make it now work.