Fixed extract_solution