Fix for issue #88 and #98