Include missing headers.
Add brackets to fix warnings.