Pulled computation of l' out.
Properly handle initial transitions.