Fix Query constructor
Add documentation