Fix for #1049