Fixing PMD and python unit test issues