The first source of bugs, often incomprehensible ones, is syntax errors, either in the input FD or in the grammar. So the first precaution is to check both inputs and grammars regularly. Use functions FD-P and GRAMMAR-P for that purpose. In grammars, check especially the number of parentheses occuring after ALTs.