more work for bug 843004. addressed victor's review comments and wrote more tests