delete obsolete test
fix SQL bugs