Start finish up the output function.
Fix the return of the metadata information.