Fix #792 by making sure we don't request samples that don't exist