Fixed solve bugs