Fix for #1245