Use stdout consistently

and fflush at end of Header
More error checks

Exit on unexpected errs in ReadRandom