Change tube id to int

This includes changing tube_id to integer and all the previous changes as well.