Better checking for inventory problems and branch matching