Fix lib detection