Added Test Query
Other bug fixes and enhancemenets.