fix tests and improve util check_availability