incorporated upstream fixes
made minor formatting tweak