Fix bug in inference of RecExtend