Fixed a class cast regression in querybox constructor