Fixed some bugs and started implementing tests for controlcolidate class