An attempt to fix #1682