Fix test types to less error prone bash versions

In addition, change comparison type when comparing git branches from numeric
to string as it was intended to be.