Added debug statements; perhaps introduced a seg fault.