Fix total_records