Fixed a bug in the auto-adding.