Fix: make sure a negative limit is not used