Fixed history handling. No longer goes out of order.