Correct bug with getMaximum(), compatibility with more data types
Correct bug in applyThreshold, compatibility with more data types