various fixes and merges