Fixed buffer length in history manipulation.