Fixed a replication bug, and updated the README and the gateway config