Detect version cleanly