Style fixes and pedantic cleanup