Fixed some phpmd and code sniff errors