applied diff.175.1 from @riban, see #465