Changed matching functions to inline versions.