BWT: sorting fixes, better constance, more debug info.