Fix environment creation