Fixed instance removal task to be called on MockAgent even when its the last instance