Fix library version discovery bug