Fix warnings

This fixes a few warnings that have accumulated in the code.