fix two bugs in recent plai commit