Add test/suite
Add test suite and fix some query issues