Fixed a few bugs within the linking phase