Fix warnings and poor c&ps.