more work for bug 843004 - started cleaning things up, fixing bugs