Some cleaning and commenting.
Still trying to figure out the binary replication bug.