allow query for virtual types (relates to #61)
remove debug output
fix error in cleanQuery