If name couldn't be read, fix filename

Before it would be empty if you didn't press amend