Improve distribution version handling