Misc cleanup in bagconverter.py