Improve panic test handling