Fix wrong file extension replacing.