++Optimize selection functions, add guard checks.