Fix file handler's handling :)

Thanks to Dario for finding this problem.