#99036031: Moves availability check into queries.