Updated for R2 changes. Fixed some sphinx warnings.