Fixed issue preventing setting of environment

Environment variable directive has been moved into an existing task, to
resolve an error.