Missing changes from Replay commit

Small bug fixes. Verified. Merging directly.