Correcting the ostream friend function