Fix for #956
Fix for #949