More fixes for non-static linking