Fix for #1009