Correct keepalive implementation.