Fix no self matrix defined error