Ensure correct version comparison

When cur_version=0~something.

(This is a corner case).