Fixes #1039 on 2.x branch.