Make the bytes casting earlier
Stripe newline chars for final output