Fixed a bug in component deletion.