[1.3.0] Fix #1377

See #1377; cherry picked from commit a9e7ba23fb02ed8ee51073167914769c7612cf23