Fixed bug 10844 - incorrect evaluation of threshold parameter, should us...

...e ton() rather than ston().