Fix clearing of activity stack after restore.