range-check and more explicit ownership with vector<ptr>

forgot a range-check

Also, tried to make all `std::vector<ptr_type>` as explicit with ownership as possible