Improved error message for invalid components.