Fix for #1018