Better error handling in detectiface()