Fixed ENVIRONMENT substitution

Since we switch user from 'root' to nexus we lose all environment variables which means that we don't update the context path as expected.