Fix problems with linear trend ordering