Fix bug in interface detection