fixed a bug where arguments that were passed from previous calls were getting saved. Also added a test to exercise the change.