fix #181, fix #180, fix #179