Even better checks for the arguments to UI.insert