Fixes for MIDI import

Fixes mostly for tuplet recognition in MIDI import.