fix #101 #143 #140 #62 #6