Fixup code that sets environment and path