Corrected add_file view and improved testcase