fixed #1 #4 #5 #6 #9 #10