Fix check on aoi length.