Corrects encoding problems, adds test script