Using QueryBuilder class from Mongo distribution, and some NullPointerExceptions removed