Fixed issue #786