Many minor fixes for variable naming