Finishing up support for issue #1021 and #1022: serialized variables and return statements in traces.
Fixed some test cases.

I must do better with this.
Merged pull request #95