Fix for issue #671

As per the comment on the reported issue, sending the pull request.....