Fixed bugs with BG message handling