Added conditional compilation for R17
Allow unexpected terms in tests