General cleanup and style fixes