various fixes and a temp hack