Fix for #1016