[BUGFIX] getcwd in some cases returns an empty string. We will check for PWD env variable.