Fix issue #338

This pull request is a possible fix for issue #338