Bug fix for #644