Make sure theta values don't hit infinity