fix some general errors with linking