Add support for matrix loading