Handle empty filename bug