Fix redundant declaration warnings for variables already defined