fix read_char and read_num, so they read to heap instead of stack