update counter before triggering latch
Merge pull request #411 from petermd/fix-schedtests

update counter before triggering latch