Improve file extension handling in converter.py