Repaired the problem with the miditest dying too early. Found another bug.