Fix loading files with special characters in filepath. Fixes #508