Chained query bugfix + documentation