Fixed get_filename_only function