Fixed issues #15, #18.