Added extensive debugging output.