Fixed cast in component.cpp