Addressed comments onpull request for specialize_branched_loops. Some minor fixes to linear solver and simplify as well.