Refactor and fix bug in PDAnalyzer test.