Replaced output file handle handling by macros.