Local variable cleanup

Some local variables were declared but not used. The variable xopt was
commented rather than deleted, since other commented lines seem to
depend on it.