Fix filename parsing when the path / filename contains a '.'