Update cachematrix.R

fix bugs in set function