fixed bug where records wouldn't be sorted if sortDirections wasn't
given.

Change-Id: I45b0a139f361f4d378433e534bb2751a969429ee