Improved error reporting for environments.