fix #4 #22 #12