Fixed a bug in RB tree and added some testing