patched cast warnings in SortDetails.cpp