fix #94, fix #95, fix #97, fix #98