Fixed issue #591: Fixed previous PR