Avoid use of discard-input. Fix #405.