Merge pull request #187 from Bigpet/master

range-check and more explicit ownership with vector<ptr>
yeah, that happened