patch looks reasonable to me... even I don't quite remember why the offending line has been added. (local testing on my remaining .rmi and .mid files show no issues) got also nested exceptions while testing playback of rmi/midi files, will have a look on these crashes