Fix issue #594