merge upstream fix. tests PASS!