Manual merge from https://github.com/ctsit/redi/pull/112