Fix for #1028