Added diagnostic printing.
Merging.