Fixed file encoding errors. Note: ugly code, will fix.