Updated checks for empty filename strings