Wbiesing/fix graphbuild library ids

@anbangx 
This morning, I merged in the library-id stuff.  This PR fixes two bugs in that code.