Added unit tests and code to check for null and empty filenames