Fixed the indexing of x.