Fix some bugs, add tests for simple circular add/remove