Fix bug in main.py

This fixes #183