Just for clarity, these are the icons I am talking about
In order to cancel building a queued unit one must click on the icon which send u to the building, then cancel production.
It would be alot more convenient to just right-click the icon (or shift-click to cancel 5 units at a time). This would help when one accidentally overproduced a unit or builds the wrong units by mistake