PMD fixes draft

Draft for PMD fixes. Not tested