Added some debug statements to hunt down a segfault that occurs occasionally.