A fix to IPH waiting code: don't wait for already finished notes, plus a...

... bit of optimization