Fix crash after stopping replay