Added error logging to RunTrials.