Create table cargos and fix some bugs