Fixes compilation warnings and the thresholding example