Better fix for #1476