Replaced regex version checking code with LooseVersion