Added tests for idempotency