Fix for issue #315