Adding -queries flag and using it in the downcast checker