Fix warnings about local variables written but not read