Fixed debug dump to use the right buffer