Analysis query updates

- Sanity checks added