Fix matrix pointer dereference bug in update.c