Fixed rare infinite loop in dialling devices. Closes #41