Check for sort parameter before using it.