Fix for #1013