Fixes titlebar to display the correct file name, and to not display names when no file is selected