Check connection type in lobject init

Fixes ticket #187.