Performance and style fixes