Fix warnings

This branch fixes several warnings, and removes the dubious use of the C++11 function std::vector::data().

Refs #1777.