Fixed issues #9 and #10 (at least I hope so!)