backport of http://www.redmine.org/issues/15870#note-12 fix to prevent completions > 100%