Test for bug in replica flag
Fixed replica flag bug