Fix deletion of old packages

Change-Id: Ic0cee93b47579f3d4f9a5ba56e8104961cd4fa58