(#1398) - Fix error determining end of replication