Some debug plotting for testing gradients. Seems like changing const.eps to 1e-3 does the trick