Fixed auto ui detection tpl scan error.

Similar to auto region detection fix.