Fix for issue #309