Fix for issue #34 and issue #90