Fix file extension removing.