Fixing bug with use after release.

Adding stuff for notifications when component is removed.
Fixing bug for removing components. (self modyfication in vector during
iteration)