Fix TypeError: 'undefined' is not an object (evaluating 'history.state.initial')

I believe the underlying issue may be ariya/phantomjs#11100