Handled target_type correctly in setTarget method