Fix for #1020