Extended fix for #6