Propagate return value in withEnv