Fixed some findbugs / pmd / cs errors