Fixed problem of incorrect number of passes run for some operations.