Fixed minor bug of redefining variables