Fix compiler warnings and errors.

Before this commit the new_bc branch failed to build with Pism_DEBUG=1.