sync with upstream af29425b1e17

also fixes some broken printf statements