Fix for #1176 improved