Fix #8 Fix #9 Fix #14 and Fix #15