Fix bad history behavior