Fixed some bugs and optimized huge parts of service/registry handling