Repackaging, fix port value error, a few unit tests