Add inverse of hex_to_str and fix bugs, comments, etc