Patch for on-the-fly regression code

Fixes #136.
![old_vs_new_fix](https://f.cloud.github.com/assets/638761/1209623/6c2c8832-25ed-11e3-86ee-3d87551a0a8e.png)