fix bug on env.c
merge alvin aymeric