Fix for #981

Fix for #981