fix #37, fix #87