fixing bug I introduced, and removing warnings