Fix error on number of allowed demands: processed demands were taken into account