Minor bug fixes.

Error with erasing objects from vectors.