fix #15 and more.