repaired test and methods, repaired sql.