Fix #539 'optimize' Method Missing from StubSessionProxy

Fixes issue #539