Fix term_read bug related to uninitialized variables