Renamed globals to have g_ prefix, similarly named arguments to have a_ prefix. Also attempted fix to prevent slow loads from overwriting outline.