Regression test for issue 417 (memory leak when replicating to DB with id >= 10)
Regression test for the main problem causing issue #141. Minor changes/fixes/additions to the test suite itself needed to write the test.