Fixed a bug in midifiles.py.