Fixed bugs in marshalling system. Typo in replica