Fix coding style errors and warnings