Made the creation of derivative matrices faster.