Protect irep of ensure.
Merge pull request #803 from masamitsu-murase/protect_irep_of_ensure

Protect proc of ensure.