Fix #605 by closing current device when another is selected