more test, debug code, and a fix or two