Mock out various pushState env cases for testing
Fix flag conditional