r lda fixes