fix some issues with LDA