Fix character encoding when reading files and minor GUI fixes