partial fix for issue #731