added a few backports to eliminate test failures and compile time warnings

could you please merge?