Improve keepalive tests