Fix for issue #151
Fix for issue #146