[PM] Fix a bunch of bugs I spotted by inspection when working on this