Fix local variables not being local