added comms core module tests and fixed some memory leks