fix compiler warnings about shadowed variables