various fixes and merges, this at least runs locally.