Fixed variable naming bugs