Fixed Matrix Bug