Fixed code in grammar for comparing rules