Fix warning and masked failure in query_chain_spec.rb