Fixed potential path problem and replaced simple bash variables by their expanded counterpart