Core: fixed a wrong consistency assertion
Tool: fixed wrong linkage order