Bug fixes, refactoring.
Protocol is dynamically set. Removed -to- method.
Comment cleanup.
Fixed: wrong function reference.