Buggy linear solver and tests added. Improving pruning.