Fix accidentally non-local variables