Fixes bug in main.run