Fix (un)marshalling logic; enable tests