Misc. fixes and formatting clean-up

replacement PR for  #7917 
Should be "pull it"?