Add decode_from_dict into main namespace, fix small bug