Corrected protocol resolving and added auto-initialization