Fix segfault in addr_to_hex