Fixed marshalling references
Added reference interop test.