Fixing bugs in solver: 2