Fixing some filename handling.