fix critical bug in FFL sort() function that could result in memory corruption