Proper replay handling

Closes #6