Fix marshalling regressions, revisit stubbing accordingly & add tests for marshalling