Fixed problem with the reference varianble and some shell commands