It builds

Also a lot of formatting.
Merge remote-tracking branch 'upstream/master' into pm_tweaks