Handling of the 'env' flag more consistent