Clean up code. Fix warnings.