Fix range_spec check