Fix for issue #8 and issue #10