Fixed some errors after the changes to fix the PMD violations