Fix possible failure as suggested in issue #4