Fix issue in which sorting broke in phantomjs and versions of android.