Moved error handling to detectiface()