Fix initialization and overwrite errors