small changes to environment handling and respecting the global Protolus, if it's there