Correctly expand $filename in the main frame's title