Fix if logic for ToolRegistry