tested compilation with/out USE_RINTERNALS
bugfix in amatch: maxDist was not obeyed