merge conflicts resolved with gregc-dev branch upstream