Fixed the domain's devices handling code.