Fixes in replay protection