changed sql file, fixed some unit tests