Fixed sh-syntax issues.
Added the check for local python virtual environment, run in it if available.