You have "error" on the first two because string after the last comma is considered as file name. Empty file name gives open file error.