Fixed a bug related to sorting and also fixed an issue where we'd zero the data out unintentionally