After much delay due to work business, fixed in latest commit. 

Fair warning: The logic to check for only the def field being populated currently lives in QueryBuilder.java since it made more sense to me. Can easily be moved/reformatted/etc if anyone has concerns with that.