Make sure number range is always between 1 and N