Fix version comparison function (#606)