Fixed bug in automatically setting variance parameters, as well as speeding up the inner loop of ROI detection significantly by only looking for NaN's in the relevant part of ROIShapes