Replace old printf with fprintf