Fix initialization of position variable