Fixed labeling bug in sql.