fix up atom checking code, add some debugging statements
fix up atom checking code, add some debugging statements

darcs-hash:829e88ff45a60083b01071e7c48f50267d9a5937

dpwright/jhc,dpwright/jhc,dpwright/jhc,dpwright/jhc