Checking for null values when matching; fixes #18