Compiler warnings fixes.

See commit messages.