Add new tests for add/remove, fix some bugs