Compile without warnings.

Fixes implicit pointer conversions, removes useless statements, and deletes unused variables.