Wan Replication fixes

This fix includes https://github.com/hazelcast/hazelcast/pull/2005