Test match element against null to provide better error messages.