fix #109, fix #108, fix #88

fix #109,
fix #108,
fix #88