fix null ptrs, misuse of bencode