fix #11, fix #18