BugFix: When inserting an optional dependency package or removing a
dep, first searches into transaction queue for them.