TB_PREFIX fixes and UI link and sql fixes