Martellaro agrees to deal with Terriers