Ted needs Amanda's help with a new prosecutor in Lester's murder trial; Erica squares off against Rick to stop him from poaching a client; Stuart and Samantha argue over Rick's position in the firm; in the past, Ted improvises after losing a witness.