Made the functions for finding the offset of a link return signed integers so they can return -1 to signify an error