Fix bug in server discovery
Replace remaining printfs by log macro