Fixing NPE while removing connection

Fixes #10