A lot of fixes that should bring full functionality