Fix bad history behaviour