#9 Fix encoding error and some fixes