Fix compiler warnings about set but unused locals