Properly detect version (fixes the tests)