Reverted a change to specialize_branched_loops that caused combinatorial explosion of code generation. Had to fix the test as well, as it was written incorrectly.