Code cleaning
some linking fixes