Fix condition for keepalive. Fixes issue #23
Merge pull request #24 from elzes/master

Fix condition for keepalive. Fixes issue #23