And a couple of error-printf bugfixes (cherry picked from commit e31153aee1c7da2bb92d8528f951b34b952d0eda)