bugfix in at_range