Fixed issue with buffers without filenames (such as *scratch*)