Fixed infinite loop when closing connection
Fixed misc warnings
Removed initial database propagation now registering is done.