Improve distribution version handling

This makes it to work on Debian. Hope it doesn't break on Ubuntu...