Fixed some errors with encoding etc.