Fixes for RStats build