Matrix bug fixed