Fix bug that prevented ascending sorting in log table