Fixed issues #10, #11, #12.