Fix tests for expiry of key