Fixed a naming bug in build_output()