Fixed NPE on sync cluster connections
Add tests for untested code #4