Fix a number of warnings

Structures with anonymous unions would a warning when you do a brace
assignment on them.

Also fixed some unused parameters and removed some unused variables.