Issue #4409: Incorrect sort order for untitled files

This PR fixes the second issue mentioned in #4409 by comparing the numbers when the filenames are the same for the exception of the number at the end of the string.

@RaymondLim I was able to get it done today.