Fixed bug related to running script as shell-script