Fix #6
Fix #8
Fix #9
Fix #10