Added removal tests and fixed bugs