minor fixes, sort result