Persist return value for wrapped functions

Small fix to persist return the value of functions wrapped with getFuncWrapper.