Fix errors in bar.py