BF - fix casting of sorter pointer
BF - prevent lookup of bad pointer when nelts == 0
RF - incorporate feedback from pull 3107