Fix #10 #9 and #8