Fix balancing, add insert, improve test coverage