Fixed some issues in test capture