Add exceptions when $lower value is greater than $upper

Also `s/%s/%d`.