Fix one corner case regarding destination file name computation.