Android replace fix

Work around issues with Android devices handling replace: true history incorrectly.