This closes the open files and correct the API from print_out_string to print_out_str. Change-Id: Icbf8c5f5421ac90de4440c04fb93184ed22ee7e5