Fix to handing of 'ans' output

I've taken a shot at fixing the lack of 'ans' output. From the testing I did, the wrapper now behaves the way I would expect MATLAB to behave.

You might want to run the test suite after this commit, since I wasn't able to do it myself.