backport #408