Fixed duplicate code for keepalive parsing. Added test for keepalive parsing.