fix #15 bugs.