Fixed #1 #2 #5.