[1.2.5] Backport #1575 from 1.3.0

See #1575