fixed #1063 #1064 #1071