BGCF fixes and general UT fixes