Fix mdapt and optimize xbr multipass.