Fixed thread try statement, corrected linkmap
Small bugfixes, added some debugging statements