various linking bug fixes