Avoid unwrapping wrapped references in transform_iterator's

implementation.

Fixes #379