fixed typo involving query.hasNext()
fixed typo
added support for modules/flush