Minor code cleanup and style changes