Fixed model bug and trace bug