Fix issues #8 and #10