Fixed bugs in communication package. Added tests