Removed unused import.
Save whether trial was internal or external.
Capture thrown exceptions.