Fix warnings about uninitialized and unused variables