Fix bug in filtering out phases to capture.