Robust Methods for Causal Inference Using Penalized Splines