Fixed a bug in compare_versions