Bug where variable name was reused and broken