Fixed a bug when a filename containing strange characters was given.