Some minor fixes
Added limited support of keep-alive connections