Improve error reporting for wrong component type