Matrix selection fix, dependency fix