Re-arrange sort by labels and modify empty keyword behaviour