Consider corner cases for upper/lower riemannsums