fixed 2 horrid encoding bugs