Simpler solution to passing a block and returning a value.

Thanks to Yuji Nakayama for this.