Whitespace changes.
Add missing braces. Patch by Ragnor.
Fix mismatches in malloc types. Patch by Ragnor.