KLD fix from master branch