fixed namebug target linking
fixed smaller issues
fixed static DIFF_ERR bug and smaller issues