Added additional checks on solutions