Fix shell logic problem in version comparison