prevent relation builder from generating NULL for array of ranges
additionally add more test coverage