Fix bug and tidy
Merge pull request #62419 from petercollingridge/solve-rat

Fix bug and tidy