Fix Unit test and code sniffer issues