Fix for #1036