Fixed more bugs in convert.py