Optimize protocols and bugfixes
bugfixes