Fixed bug #81192 Normally the filename is the current filename, but when traits are involved, it might be a different one.