Fixed incorrect changes for mat.js