Improve version check and bash script fix