Improved: Reduced invalid grammar nodes search