merge some old changes

that were not ported back to this repo