Fixed Terrplant unit tests and cleaned up terrplant and sip.

Will start working on SIP unit tests