Add support of multi-way wire.
Fix some bugs