Fixes stopping at the last problem instead of the first one