Improved solution checking.