Changed matrix pass type to shader to a less segfault-prone format. Fixed inconsistencies.