UB/MB improvements; various bug fixes.