Fixed bugs when running setup.py.