Corrected order sorting function for Chrome, IE.