Corrections/cleanup from zypper batching refactor

This builds on pull request #7510, correcting a logic issue as well as
making some PEP8 fixes.