Fix shadowed variables and enable -Wshadow