Fixpr

fix a subset of the bugs in your PR