Fix #595

Fixed issue #595