Nicholas Castellanos agrees to deal with Reds