Adding debug info and fixing a bug.