Fix midi scan func.