Style fixes and code cleanup