Fix autoenv_new().

I initially wrote autoenv_new() quickly on the GitHub editor,
so it wasn't tested properly at that point. I tested it
and realized I'd made some mistakes. Now fixed. Works as expected.