Fix for #1031.