Fix for #1003