Make device count const, update runtime check