Fixed table names and min comparison