Correct object names in 'raster' call
Add 'nrow' value when making a matrix from a vector