Cleaning matrix and vector classes