Fixed bug with threshold datatype