Fix for issue #318