Fixed a bug in uncertainty code. Freq range was not taken into account correctly