Partially fix #2667