fixed encoding, and added some broken tests
fixed broken tests