Record/replay and performance fix