Fix sort bugs

* Fixed an error when attempting to sort a column containing null values
* Fixed an issue where reverse order persisted after cycling through ascending/descending order (since originalRecords didn't actually contain the original records)