Fix bug in transform matricies (only keeping first dimension)